package Work139;

/**
 * @Author admin
 * @Date 2019/3/19 13:46
 */
 class ConsBank extends  Bank{
     double year;
    public ConsBank() {

    }

    public ConsBank(int money, double rate, double year) {
        super(money, rate);
        this.year = year;
    }

    @Override
    public double compulnterest() {
        super.year=(int)year;
        int day=(int)((year-super.year)*1000);
        double yearInter =super.compulnterest();
        double dayInter=day*money*0.0001;
        System.out.println("利息是"+(yearInter+dayInter)+"存了"+super.year+"年"+day+"天");
        return yearInter+dayInter;
    }
}
